package LC;

import java.util.ArrayList;
import java.util.List;

public class LC119 {
    public List<Integer> getRow(int rowIndex) {
        List<Integer> ans = new ArrayList<>();
        for (int i = 0; i <= rowIndex; i++) {
                ans.add(sub(rowIndex,Math.min(i,rowIndex-i)));
        }
        return  ans;
    }
    int sub(int base,int sub){
        double ans = 1.0;
        for (int i = 1; i <= sub; i++) {
            ans = ans *(base -i  +1) / i;
        }

        return  (int)ans;

    }
}
